#ifndef CORESERVICE_H
#define CORESERVICE_H

#include "corecommon.h"

#include "project.h"
#include "word.h"
#include "document.h"
#include "statement.h"

namespace TA {

class CoreService : public QObject
{
    Q_OBJECT
public:
    explicit CoreService(QObject *parent = 0);

signals:

public slots:
    Project* createProject(QObject* parent,const QString& title);
    //Project* loadProject(QObject* parent);

    Document* appendDocument(Project* p,const QString& docTitle,const QString& content);

    StatementRawPtrArray discriminateDoc(Document* doc,const QString& sep);

    WordRawPtrArray analyzeStatements(const StatementRawPtrArray& statements,Document* doc);

    bool isChineseCode(const QChar c);
    bool isAlphabetic(const QChar c);
    bool isDigit(const QChar c);

    bool acceptChar(const QChar c,const QList<QChar>& seps);

    WordType codeType(const QChar c);

};

}

#endif // CORESERVICE_H
